package com.lbs.jiepiaisi.activity;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.webkit.WebChromeClient;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;

import com.lbs.jiepiaisi.R;
import com.lbs.jiepiaisi.base.BaseActivity;
import com.lbs.jiepiaisi.bean.NewsEntity;

public class NewsDetailActivity extends BaseActivity {

    private WebView mWebData;

    private NewsEntity.Result.Data news;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        isTemplate = true;
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_news_deatil);
        titleView.setText("资讯详情");
        findView();
        getData();
        setListener();
    }
    public void findView(){
        mWebData = (WebView)findViewById(R.id.wb_data);
        // 不使用缓存
        mWebData.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);
        // 支持JavaScript
        mWebData.getSettings().setJavaScriptEnabled(false);
        mWebData.setWebChromeClient(new WebChromeClient());
        mWebData.setWebViewClient(new WebViewClient());
    }
    public void getData(){
        news = (NewsEntity.Result.Data)getIntent().getSerializableExtra("news");
        mWebData.loadUrl(news.getUrl());
    }
    public void setListener(){

    }
}
